<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>
        {% block title %}
        {% endblock %}
    </title>
</head>
<body>
<header style="display: flex;justify-content: space-around;">
    {% if request.session.username and request.session.uid %}
        <p>欢迎 {{ request.session.username }}</p>
        <p>
            <a href="javascript:">退出登录</a>
        </p>
        <p>
            <a href="javascript:">进入我的笔记</a>
        </p>
    {% else %}
        {% if request.COOKIES.username and request.COOKIES.uid %}
            <p>欢迎 {{ request.COOKIES.username }}</p>
            <p>
                <a href="javascript:">退出登录</a>
            </p>
            <p>
                <a href="javascript:">进入我的笔记</a>
            </p>
        {% else %}
            <p>
                <a href="/user/login/">登录</a>
                <a href="/user/register/">注册</a>
            </p>
        {% endif %}
    {% endif %}
</header>

<div style="display: flex;justify-content: center;margin-top: 88px">
    {% block main %}
    {% endblock %}
</div>
</body>
</html>